package cn.itsource.controller.app;

import cn.itsource.pojo.app.dto.MpRegisterDto;
import cn.itsource.service.IDriverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import cn.itsource.result.JSONResult;
import javax.validation.Valid;

@Tag(name = "App端司机API",description = "App端司机API")
@RestController
@RequestMapping("/app")
public class AppDriverController{

    @Autowired
    public IDriverService driverService;

    @Operation( summary= "司机小程序注册",description = "司机小程序注册")
    @Parameter(name = "wxCode",description = "微信Code",required = true)
    @PostMapping("/mp/register")
    public JSONResult mpRegister(@RequestBody @Valid MpRegisterDto dto){
        return JSONResult.success(driverService.mpRegister(dto));
    }
}
